﻿@model Model.AppUserList
@{
    ViewBag.Title = "GoodsMoveItem";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@section JQscriptSection{
    <script src="../../Scripts/viewsScript/GoodsMove/GoodsMoveItemC.js" type="text/javascript"></script>
    <script src="../../Scripts/viewsScript/Common/MyDialog.js" type="text/javascript"></script>
    <script src="../../Scripts/jqueryeasyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            //加载菜单
            // InitGrid();
            $('#loginOut').click(function () {
                $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {
                    if (r) {
                        $.ajax({
                            type: "POST",
                            url: '@Url.Action("LogOut", "Account")',
                            success: function (data) {
                                location.href = '@Url.Action("LogOn", "Account")';
                            }
                        });
                        }
                });
            })
        });
            function checklocationcode() {
                var code = $.trim($("#txtLocationCode").attr("value"));
                if (code != "") {
                    $('#location').form('submit', {
                        url: "/Location/checkLocationExist?code=" + code,
                        success: function (data) {
                            eval('data=' + data);
                            if (data.success) {

                            } else {
                                $.messager.alert('错误', data.msg, 'error');
                                $("#txtLocationCode").val("").focus();
                            }
                        }
                    });
                }
            }
            function checkgoodscode() {
                var code = $.trim($("#txtGoodsCode").attr("value"));
                if (code != "") {
                    $('#location').form('submit', {
                        url: '@Url.Content("~/Location/checkGoodsExist")',
                        success: function (data) {
                            eval('data=' + data);
                            if (data.success) {

                            } else {
                                $.messager.alert('错误', data.msg, 'error');
                                $("#txtGoodsCode").val("").focus();
                            }
                        }
                    });
                }
            }

            function ExporterExcel() {
                var form = $('#location');
                var rows = $(".pagination-page-list option:selected").text();
                var page = $("input[size='2']").val();
                form.form('submit', {
                    url: '@Url.Content("~/GoodsMove/ExportExcelDetail")' + '?page=' + page + '&rows=' + rows,
                success: function (data) {
                    eval('data=' + data);
                    if (data.success) {
                        InitGrid();
                    } else {
                        $.messager.alert('错误', data.msg, 'error');
                    }
                    //$("#txtOrdSubjectCode").val("");
                }
            });
        }
    </script>
}
<body style="background-color: ButtonFace; font-size: 17px" onload="InitGrid();">

    <div region="north" split="true" border="false" style="overflow: hidden; height: 51px; color: #000000; background: url(../Content/Ext/resources/themes/images/gray/panel-header-default-bottom-bg.gif); font-family: Verdana, 微软雅黑,黑体">
        <span style="float: right; padding-right: 10px; padding-top: 30px;" class="head">欢迎:@Model.USERNAME <a
            href="#" id="loginOut">安全退出</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/Home/Index" id="HomeIndex">返回首页</a></span>

        <span style="padding-left: 10px; font-size: 20px;">
            <img src="/Content/images/blocks.gif" width="20" height="20" align="absmiddle" />
            我厨&reg - 货位商品关联
        </span>
    </div>
    <div id="p2" class="easyui-panel" title="查询条件" style="height: 35px; padding: 5px; background: #fafafa;">
        <table>
            <tr>
                <td>搬移单号:
                </td>
                <td>
                    <input id="txtSGoodsMoveID" name="txtSGoodsMoveID" style="width: 154px"/>
                </td>
                <td>商品批次号:
                </td>
                <td>
                    <input id="txtSGoodsBatchCode" name="txtSGoodsBatchCode" style="width: 154px" />
                </td>
                <td></td>
                <td>
                    <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid()">查询</a>
                </td>
                @using (Html.BeginForm("ImportLocationGoods", "Location", FormMethod.Post, new { enctype = "multipart/form-data" }))
                {
                    <td>
                        <input id="FileUpload" type="file" name="files" style="width: 250px; height: 24px; background: White"
                            class="easyui-validatebox" />
                        <input id="btnImport" type="submit" value="导入" class="easyui-linkbutton" style="width: 60px; height: 28px;" />
                    </td>
                }
                <td>
                    <a id="btnExecl" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" onclick="ExporterExcel()">导出</a>
                </td>
            </tr>
        </table>
    </div>

    <div>
        <table id="tab_list">
        </table>
    </div>
    <div id="p1" class="easyui-dialog" style="width: 650px; height: 240px; padding: 10px 20px" closed="true" buttons="#dlg-buttons">
        <form id="location" method="post">
            <table>
                <tr>
                    <td>搬移单号:
                    </td>
                    <td>
                        <input id="hiddenSEQNO" name="hiddenSEQNO" type="hidden" />
                        <input id="txtGoodsMoveID" name="txtGoodsMoveID" maxlength="20" style="width: 154px" onblur="checkgoodsmoveid()" />
                    </td>
                    <td>商品批次号:
                    </td>
                    <td colspan="2">
                        <input id="txtGoodsBatchCode" name="txtGoodsBatchCode" maxlength="10" style="width: 154px" />
                    </td>
                </tr>
                <tr>
                    <td>来源货位编码:
                    </td>
                    <td>
                        <input id="txtFromLocationCode" name="txtFromLocationCode" maxlength="20" style="width: 154px" onblur="checklocationcode()" />
                    </td>
                    <td>目的货位编码:
                    </td>
                    <td colspan="2">
                        <input id="txtToLocationCode" name="txtToLocationCode" maxlength="20" style="width: 154px" onblur="checklocationcode()" />
                    </td>
                </tr>
                <tr>
                    <td>数量:
                    </td>
                    <td>
                        <input id="txtQty" name="txtQty" maxlength="20" style="width: 154px" />
                    </td>
                    <td>下架指令:
                    </td>
                    <td colspan="2">
                        <input id="txtOffShelvesID" name="txtOffShelvesID" maxlength="20" style="width: 154px" />
                    </td>
                </tr>

                <tr>
                    <td colspan="5">
                        <a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-preview'" onclick="save()">保存</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>

</body>
